home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / MIDI.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  22.6 KB  |  614 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        MIDI.h
  3.  
  4.      Contains:    MIDI Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1988-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __MIDI__
  18. #define __MIDI__
  19.  
  20. #ifndef __MACERRORS__
  21.     #include <MacErrors.h>
  22. #endif
  23.  
  24. #ifndef __MACTYPES__
  25.     #include <MacTypes.h>
  26. #endif
  27.  
  28. #ifndef __MIXEDMODE__
  29.     #include <MixedMode.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. /*
  56.                         * * *  N O T E  * * * 
  57.  
  58.     This file has been updated to include MIDI 2.0 interfaces.  
  59.     
  60.     The MIDI 2.0 interfaces were developed for the classic 68K runtime.
  61.     Since then, Apple has created the PowerPC and CFM 68K runtimes.
  62.     Currently, the extra functions in MIDI 2.0 are not in InterfaceLib
  63.     and thus not callable from PowerPC and CFM 68K runtimes (you'll
  64.     get a linker error).  
  65. */
  66. enum {
  67.     midiMaxNameLen                = 31                            /*maximum number of characters in port and client names*/
  68. };
  69.  
  70. enum {
  71.                                                                 /* Time formats */
  72.     midiFormatMSec                = 0,                            /*milliseconds*/
  73.     midiFormatBeats                = 1,                            /*beats*/
  74.     midiFormat24fpsBit            = 2,                            /*24 frames/sec.*/
  75.     midiFormat25fpsBit            = 3,                            /*25 frames/sec.*/
  76.     midiFormat30fpsDBit            = 4,                            /*30 frames/sec. drop-frame*/
  77.     midiFormat30fpsBit            = 5,                            /*30 frames/sec.*/
  78.     midiFormat24fpsQF            = 6,                            /*24 frames/sec. longInt format */
  79.     midiFormat25fpsQF            = 7,                            /*25 frames/sec. longInt format */
  80.     midiFormat30fpsDQF            = 8,                            /*30 frames/sec. drop-frame longInt format */
  81.     midiFormat30fpsQF            = 9                                /*30 frames/sec. longInt format */
  82. };
  83.  
  84. enum {
  85.     midiInternalSync            = 0,                            /*internal sync*/
  86.     midiExternalSync            = 1                                /*external sync*/
  87. };
  88.  
  89. enum {
  90.                                                                 /* Port types*/
  91.     midiPortTypeTime            = 0,                            /*time port*/
  92.     midiPortTypeInput            = 1,                            /*input port*/
  93.     midiPortTypeOutput            = 2,                            /*output port*/
  94.     midiPortTypeTimeInv            = 3,                            /*invisible time port*/
  95.     midiPortInvisible            = 0x8000,                        /*logical OR this to other types to make invisible ports*/
  96.     midiPortTypeMask            = 0x0007                        /*logical AND with this to convert new port types to old, i.e. to strip the property bits*/
  97. };
  98.  
  99. enum {
  100.                                                                 /* OffsetTimes  */
  101.     midiGetEverything            = 0x7FFFFFFF,                    /*get all packets, regardless of time stamps*/
  102.     midiGetNothing                = (long)0x80000000,                /*get no packets, regardless of time stamps*/
  103.     midiGetCurrent                = 0x00000000                    /*get current packets only*/
  104. };
  105.  
  106. /*    MIDI data and messages are passed in MIDIPacket records (see below).
  107.     The first byte of every MIDIPacket contains a set of flags
  108.  
  109.     bits 0-1    00 = new MIDIPacket, not continued
  110.                      01 = begining of continued MIDIPacket
  111.                      10 = end of continued MIDIPacket
  112.                      11 = continuation
  113.     bits 2-3     reserved
  114.  
  115.     bits 4-6      000 = packet contains MIDI data
  116.  
  117.                   001 = packet contains MIDI Manager message
  118.  
  119.     bit 7         0 = MIDIPacket has valid stamp
  120.                   1 = stamp with current clock
  121. */
  122. enum {
  123.     midiContMask                = 0x03,
  124.     midiNoCont                    = 0x00,
  125.     midiStartCont                = 0x01,
  126.     midiMidCont                    = 0x03,
  127.     midiEndCont                    = 0x02,
  128.     midiTypeMask                = 0x70,
  129.     midiMsgType                    = 0x00,
  130.     midiMgrType                    = 0x10,
  131.     midiTimeStampMask            = 0x80,
  132.     midiTimeStampCurrent        = 0x80,
  133.     midiTimeStampValid            = 0x00
  134. };
  135.  
  136. enum {
  137.                                                                 /* MIDIPacket command words (the first word in the data field for midiMgrType messages) */
  138.     midiOverflowErr                = 0x0001,
  139.     midiSCCErr                    = 0x0002,
  140.     midiPacketErr                = 0x0003,                        /*all command words less than this value are error indicators*/
  141.     midiMaxErr                    = 0x00FF
  142. };
  143.  
  144. enum {
  145.                                                                 /* Valid results to be returned by readHooks */
  146.     midiKeepPacket                = 0,
  147.     midiMorePacket                = 1,
  148.     midiNoMorePacket            = 2,
  149.     midiHoldPacket                = 3
  150. };
  151.  
  152. enum {
  153.                                                                 /* Driver calls */
  154.     midiOpenDriver                = 1,
  155.     midiCloseDriver                = 2
  156. };
  157.  
  158. enum {
  159.     mdvrAbortNotesOff            = 0,                            /*abort previous mdvrNotesOff request*/
  160.     mdvrChanNotesOff            = 1,                            /*generate channel note off messages*/
  161.     mdvrAllNotesOff                = 2                                /*generate all note off messages*/
  162. };
  163.  
  164. enum {
  165.     mdvrStopOut                    = 0,                            /*stop calling MDVROut temporarily*/
  166.     mdvrStartOut                = 1                                /*resume calling MDVROut*/
  167. };
  168.  
  169.  
  170. struct MIDIPacket {
  171.     UInt8                             flags;
  172.     UInt8                             len;
  173.     long                             tStamp;
  174.     UInt8                             data[249];
  175. };
  176. typedef struct MIDIPacket                MIDIPacket;
  177. typedef MIDIPacket *                    MIDIPacketPtr;
  178. typedef CALLBACK_API( short , MIDIReadHookProcPtr )(MIDIPacketPtr myPacket, long myRefCon);
  179. typedef CALLBACK_API( void , MIDITimeProcPtr )(long curTime, long myRefCon);
  180. typedef CALLBACK_API( void , MIDIConnectionProcPtr )(short refnum, long refcon, short portType, OSType clientID, OSType portID, Boolean connect, short direction);
  181. typedef CALLBACK_API( long , MDVRCommProcPtr )(short refnum, short request, long refCon);
  182. typedef CALLBACK_API( void , MDVRTimeCodeProcPtr )(short refnum, short newFormat, long refCon);
  183. typedef CALLBACK_API( void , MDVRReadProcPtr )(char *midiChars, short length, long refCon);
  184. typedef STACK_UPP_TYPE(MIDIReadHookProcPtr)                     MIDIReadHookUPP;
  185. typedef STACK_UPP_TYPE(MIDITimeProcPtr)                         MIDITimeUPP;
  186. typedef STACK_UPP_TYPE(MIDIConnectionProcPtr)                     MIDIConnectionUPP;
  187. typedef STACK_UPP_TYPE(MDVRCommProcPtr)                         MDVRCommUPP;
  188. typedef STACK_UPP_TYPE(MDVRTimeCodeProcPtr)                     MDVRTimeCodeUPP;
  189. typedef STACK_UPP_TYPE(MDVRReadProcPtr)                         MDVRReadUPP;
  190.  
  191. struct MIDIClkInfo {
  192.     short                             syncType;                    /*synchronization external/internal*/
  193.     long                             curTime;                    /*current value of port's clock*/
  194.     short                             format;                        /*time code format*/
  195. };
  196. typedef struct MIDIClkInfo                MIDIClkInfo;
  197.  
  198. struct MIDIIDRec {
  199.     OSType                             clientID;
  200.     OSType                             portID;
  201. };
  202. typedef struct MIDIIDRec                MIDIIDRec;
  203.  
  204. struct MIDIPortInfo {
  205.     short                             portType;                    /*type of port*/
  206.     MIDIIDRec                         timeBase;                    /*MIDIIDRec for time base*/
  207.     short                             numConnects;                /*number of connections*/
  208.     MIDIIDRec                         cList[1];                    /*ARRAY [1..numConnects] of MIDIIDRec*/
  209. };
  210. typedef struct MIDIPortInfo                MIDIPortInfo;
  211. typedef MIDIPortInfo *                    MIDIPortInfoPtr;
  212. typedef MIDIPortInfoPtr *                MIDIPortInfoHdl;
  213. typedef MIDIPortInfoPtr *                MIDIPortInfoHandle;
  214.  
  215. struct MIDIPortParams {
  216.     OSType                             portID;                        /*ID of port, unique within client*/
  217.     short                             portType;                    /*Type of port - input, output, time, etc.*/
  218.     short                             timeBase;                    /*refnum of time base, 0 if none*/
  219.     long                             offsetTime;                    /*offset for current time stamps*/
  220.     MIDIReadHookUPP                 readHook;                    /*routine to call when input data is valid*/
  221.     long                             refCon;                        /*refcon for port (for client use)*/
  222.     MIDIClkInfo                     initClock;                    /*initial settings for a time base*/
  223.     Str255                             name;                        /*name of the port, This is a real live string, not a ptr.*/
  224. };
  225. typedef struct MIDIPortParams            MIDIPortParams;
  226. typedef MIDIPortParams *                MIDIPortParamsPtr;
  227.  
  228. struct MIDIIDList {
  229.     short                             numIDs;
  230.     OSType                             list[1];
  231. };
  232. typedef struct MIDIIDList                MIDIIDList;
  233. typedef MIDIIDList *                    MIDIIDListPtr;
  234. typedef MIDIIDListPtr *                    MIDIIDListHdl;
  235. typedef MIDIIDListPtr *                    MIDIIDListHandle;
  236. /* MDVR Control structs*/
  237.  
  238. struct MDVRInCtlRec {
  239.     short                             timeCodeClock;                /*refnum of time base for time code*/
  240.     short                             timeCodeFormat;                /*format of time code output*/
  241.     MDVRReadUPP                     readProc;                    /*proc to call with intput characters*/
  242.     MDVRCommUPP                     commProc;                    /*proc to call for handshaking*/
  243.     long                             refCon;                        /*refCon passed to readProc, commProc*/
  244. };
  245. typedef struct MDVRInCtlRec                MDVRInCtlRec;
  246.  
  247. typedef MDVRInCtlRec *                    MDVRInCtlPtr;
  248.  
  249. struct MDVROutCtlRec {
  250.     short                             timeCodeClock;                /*time base driven by time code*/
  251.     short                             timeCodeFormat;                /*format of time code to listen to*/
  252.     MDVRTimeCodeUPP                 timeCodeProc;                /*proc called on time code fmt change*/
  253.     MDVRCommUPP                     commProc;                    /*proc called for handshaking*/
  254.     long                             refCon;                        /*refCon passed to timeCodeProc*/
  255.     Boolean                         timeCodeFilter;                /*filter time code if true*/
  256.     UInt8                             padding;                    /*unused pad byte*/
  257.     long                             midiMsgTicks;                /*value of Ticks when MIDI msg rcvd*/
  258.     long                             timeCodeTicks;                /*value of Ticks when time code rcvd*/
  259. };
  260. typedef struct MDVROutCtlRec            MDVROutCtlRec;
  261.  
  262. typedef MDVROutCtlRec *                    MDVROutCtlPtr;
  263. typedef void *                            MDVRPtr;
  264. EXTERN_API( NumVersion )
  265. MIDIVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0004, 0xA800);
  266.  
  267. EXTERN_API( OSErr )
  268. MIDISignIn                        (OSType                 clientID,
  269.                                  long                     refCon,
  270.                                  Handle                 icon,
  271.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xA800);
  272.  
  273. EXTERN_API( void )
  274. MIDISignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0008, 0x0004, 0xA800);
  275.  
  276. EXTERN_API( MIDIIDListHandle )
  277. MIDIGetClients                    (void)                                                        FOURWORDINLINE(0x203C, 0x000C, 0x0004, 0xA800);
  278.  
  279. EXTERN_API( void )
  280. MIDIGetClientName                (OSType                 clientID,
  281.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xA800);
  282.  
  283. EXTERN_API( void )
  284. MIDISetClientName                (OSType                 clientID,
  285.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0014, 0x0004, 0xA800);
  286.  
  287. EXTERN_API( MIDIIDListHandle )
  288. MIDIGetPorts                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0018, 0x0004, 0xA800);
  289.  
  290. EXTERN_API( OSErr )
  291. MIDIAddPort                        (OSType                 clientID,
  292.                                  short                     BufSize,
  293.                                  short *                refnum,
  294.                                  MIDIPortParamsPtr         init)                                FOURWORDINLINE(0x203C, 0x001C, 0x0004, 0xA800);
  295.  
  296. EXTERN_API( MIDIPortInfoHandle )
  297. MIDIGetPortInfo                    (OSType                 clientID,
  298.                                  OSType                 portID)                                FOURWORDINLINE(0x203C, 0x0020, 0x0004, 0xA800);
  299.  
  300. EXTERN_API( OSErr )
  301. MIDIConnectData                    (OSType                 srcClID,
  302.                                  OSType                 srcPortID,
  303.                                  OSType                 dstClID,
  304.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0024, 0x0004, 0xA800);
  305.  
  306. EXTERN_API( OSErr )
  307. MIDIUnConnectData                (OSType                 srcClID,
  308.                                  OSType                 srcPortID,
  309.                                  OSType                 dstClID,
  310.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0028, 0x0004, 0xA800);
  311.  
  312. EXTERN_API( OSErr )
  313. MIDIConnectTime                    (OSType                 srcClID,
  314.                                  OSType                 srcPortID,
  315.                                  OSType                 dstClID,
  316.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x002C, 0x0004, 0xA800);
  317.  
  318. EXTERN_API( OSErr )
  319. MIDIUnConnectTime                (OSType                 srcClID,
  320.                                  OSType                 srcPortID,
  321.                                  OSType                 dstClID,
  322.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0030, 0x0004, 0xA800);
  323.  
  324. EXTERN_API( void )
  325. MIDIFlush                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0034, 0x0004, 0xA800);
  326.  
  327. EXTERN_API( ProcPtr )
  328. MIDIGetReadHook                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0038, 0x0004, 0xA800);
  329.  
  330. EXTERN_API( void )
  331. MIDISetReadHook                    (short                     refnum,
  332.                                  ProcPtr                 hook)                                FOURWORDINLINE(0x203C, 0x003C, 0x0004, 0xA800);
  333.  
  334. EXTERN_API( void )
  335. MIDIGetPortName                    (OSType                 clientID,
  336.                                  OSType                 portID,
  337.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0040, 0x0004, 0xA800);
  338.  
  339. EXTERN_API( void )
  340. MIDISetPortName                    (OSType                 clientID,
  341.                                  OSType                 portID,
  342.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0044, 0x0004, 0xA800);
  343.  
  344. EXTERN_API( void )
  345. MIDIWakeUp                        (short                     refnum,
  346.                                  long                     time,
  347.                                  long                     period,
  348.                                  MIDITimeUPP             timeProc)                            FOURWORDINLINE(0x203C, 0x0048, 0x0004, 0xA800);
  349.  
  350. EXTERN_API( void )
  351. MIDIRemovePort                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x004C, 0x0004, 0xA800);
  352.  
  353. EXTERN_API( short )
  354. MIDIGetSync                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0050, 0x0004, 0xA800);
  355.  
  356. EXTERN_API( void )
  357. MIDISetSync                        (short                     refnum,
  358.                                  short                     sync)                                FOURWORDINLINE(0x203C, 0x0054, 0x0004, 0xA800);
  359.  
  360. EXTERN_API( long )
  361. MIDIGetCurTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0058, 0x0004, 0xA800);
  362.  
  363. EXTERN_API( void )
  364. MIDISetCurTime                    (short                     refnum,
  365.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x005C, 0x0004, 0xA800);
  366.  
  367. EXTERN_API( void )
  368. MIDIStartTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0060, 0x0004, 0xA800);
  369.  
  370. EXTERN_API( void )
  371. MIDIStopTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0064, 0x0004, 0xA800);
  372.  
  373. EXTERN_API( void )
  374. MIDIPoll                        (short                     refnum,
  375.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0068, 0x0004, 0xA800);
  376.  
  377. EXTERN_API( OSErr )
  378. MIDIWritePacket                    (short                     refnum,
  379.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x006C, 0x0004, 0xA800);
  380.  
  381. EXTERN_API( Boolean )
  382. MIDIWorldChanged                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0070, 0x0004, 0xA800);
  383.  
  384. EXTERN_API( long )
  385. MIDIGetOffsetTime                (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0074, 0x0004, 0xA800);
  386.  
  387. EXTERN_API( void )
  388. MIDISetOffsetTime                (short                     refnum,
  389.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0078, 0x0004, 0xA800);
  390.  
  391. EXTERN_API( long )
  392. MIDIConvertTime                    (short                     srcFormat,
  393.                                  short                     dstFormat,
  394.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x007C, 0x0004, 0xA800);
  395.  
  396. EXTERN_API( long )
  397. MIDIGetRefCon                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0080, 0x0004, 0xA800);
  398.  
  399. EXTERN_API( void )
  400. MIDISetRefCon                    (short                     refnum,
  401.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x0084, 0x0004, 0xA800);
  402.  
  403. EXTERN_API( long )
  404. MIDIGetClRefCon                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0088, 0x0004, 0xA800);
  405.  
  406. EXTERN_API( void )
  407. MIDISetClRefCon                    (OSType                 clientID,
  408.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x008C, 0x0004, 0xA800);
  409.  
  410. EXTERN_API( short )
  411. MIDIGetTCFormat                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0090, 0x0004, 0xA800);
  412.  
  413. EXTERN_API( void )
  414. MIDISetTCFormat                    (short                     refnum,
  415.                                  short                     format)                                FOURWORDINLINE(0x203C, 0x0094, 0x0004, 0xA800);
  416.  
  417. EXTERN_API( void )
  418. MIDISetRunRate                    (short                     refnum,
  419.                                  short                     rate,
  420.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x0098, 0x0004, 0xA800);
  421.  
  422. EXTERN_API( Handle )
  423. MIDIGetClientIcon                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x009C, 0x0004, 0xA800);
  424.  
  425. EXTERN_API( ProcPtr )
  426. MIDICallAddress                    (short                     callNum)                            FOURWORDINLINE(0x203C, 0x00A4, 0x0004, 0xA800);
  427.  
  428. EXTERN_API( void )
  429. MIDISetConnectionProc            (short                     refNum,
  430.                                  ProcPtr                 connectionProc,
  431.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x00A8, 0x0004, 0xA800);
  432.  
  433. EXTERN_API( void )
  434. MIDIGetConnectionProc            (short                     refnum,
  435.                                  ProcPtr *                connectionProc,
  436.                                  long *                    refCon)                                FOURWORDINLINE(0x203C, 0x00AC, 0x0004, 0xA800);
  437.  
  438. EXTERN_API( void )
  439. MIDIDiscardPacket                (short                     refnum,
  440.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x00B0, 0x0004, 0xA800);
  441.  
  442. EXTERN_API( OSErr )
  443. MDVRSignIn                        (OSType                 clientID,
  444.                                  long                     refCon,
  445.                                  Handle                 icon,
  446.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x00B4, 0x0004, 0xA800);
  447.  
  448. EXTERN_API( void )
  449. MDVRSignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x00B8, 0x0004, 0xA800);
  450.  
  451. EXTERN_API( MDVRPtr )
  452. MDVROpen                        (short                     portType,
  453.                                  short                     refnum)                                FOURWORDINLINE(0x203C, 0x00BC, 0x0004, 0xA800);
  454.  
  455. EXTERN_API( void )
  456. MDVRClose                        (MDVRPtr                 driverPtr)                            FOURWORDINLINE(0x203C, 0x00C0, 0x0004, 0xA800);
  457.  
  458. EXTERN_API( void )
  459. MDVRControlIn                    (MDVRPtr                 portPtr,
  460.                                  MDVRInCtlPtr             inputCtl)                            FOURWORDINLINE(0x203C, 0x00C4, 0x0004, 0xA800);
  461.  
  462. EXTERN_API( void )
  463. MDVRControlOut                    (MDVRPtr                 portPtr,
  464.                                  MDVROutCtlPtr             outputCtl)                            FOURWORDINLINE(0x203C, 0x00C8, 0x0004, 0xA800);
  465.  
  466. EXTERN_API( void )
  467. MDVRIn                            (MDVRPtr                 portPtr)                            FOURWORDINLINE(0x203C, 0x00CC, 0x0004, 0xA800);
  468.  
  469. EXTERN_API( void )
  470. MDVROut                            (MDVRPtr                 portPtr,
  471.                                  char *                    dataPtr,
  472.                                  short                     length)                                FOURWORDINLINE(0x203C, 0x00D0, 0x0004, 0xA800);
  473.  
  474. EXTERN_API( void )
  475. MDVRNotesOff                    (MDVRPtr                 portPtr,
  476.                                  short                     mode)                                FOURWORDINLINE(0x203C, 0x00D4, 0x0004, 0xA800);
  477.  
  478. #if OPAQUE_UPP_TYPES
  479.     EXTERN_API(MIDIReadHookUPP)
  480.     NewMIDIReadHookUPP               (MIDIReadHookProcPtr        userRoutine);
  481.  
  482.     EXTERN_API(MIDITimeUPP)
  483.     NewMIDITimeUPP                   (MIDITimeProcPtr            userRoutine);
  484.  
  485.     EXTERN_API(MIDIConnectionUPP)
  486.     NewMIDIConnectionUPP           (MIDIConnectionProcPtr    userRoutine);
  487.  
  488.     EXTERN_API(MDVRCommUPP)
  489.     NewMDVRCommUPP                   (MDVRCommProcPtr            userRoutine);
  490.  
  491.     EXTERN_API(MDVRTimeCodeUPP)
  492.     NewMDVRTimeCodeUPP               (MDVRTimeCodeProcPtr        userRoutine);
  493.  
  494.     EXTERN_API(MDVRReadUPP)
  495.     NewMDVRReadUPP                   (MDVRReadProcPtr            userRoutine);
  496.  
  497.     EXTERN_API(void)
  498.     DisposeMIDIReadHookUPP           (MIDIReadHookUPP            userUPP);
  499.  
  500.     EXTERN_API(void)
  501.     DisposeMIDITimeUPP               (MIDITimeUPP                userUPP);
  502.  
  503.     EXTERN_API(void)
  504.     DisposeMIDIConnectionUPP       (MIDIConnectionUPP        userUPP);
  505.  
  506.     EXTERN_API(void)
  507.     DisposeMDVRCommUPP               (MDVRCommUPP                userUPP);
  508.  
  509.     EXTERN_API(void)
  510.     DisposeMDVRTimeCodeUPP           (MDVRTimeCodeUPP            userUPP);
  511.  
  512.     EXTERN_API(void)
  513.     DisposeMDVRReadUPP               (MDVRReadUPP                userUPP);
  514.  
  515.     EXTERN_API(short)
  516.     InvokeMIDIReadHookUPP           (MIDIPacketPtr            myPacket,
  517.                                     long                    myRefCon,
  518.                                     MIDIReadHookUPP            userUPP);
  519.  
  520.     EXTERN_API(void)
  521.     InvokeMIDITimeUPP               (long                    curTime,
  522.                                     long                    myRefCon,
  523.                                     MIDITimeUPP                userUPP);
  524.  
  525.     EXTERN_API(void)
  526.     InvokeMIDIConnectionUPP           (short                    refnum,
  527.                                     long                    refcon,
  528.                                     short                    portType,
  529.                                     OSType                    clientID,
  530.                                     OSType                    portID,
  531.                                     Boolean                    connect,
  532.                                     short                    direction,
  533.                                     MIDIConnectionUPP        userUPP);
  534.  
  535.     EXTERN_API(long)
  536.     InvokeMDVRCommUPP               (short                    refnum,
  537.                                     short                    request,
  538.                                     long                    refCon,
  539.                                     MDVRCommUPP                userUPP);
  540.  
  541.     EXTERN_API(void)
  542.     InvokeMDVRTimeCodeUPP           (short                    refnum,
  543.                                     short                    newFormat,
  544.                                     long                    refCon,
  545.                                     MDVRTimeCodeUPP            userUPP);
  546.  
  547.     EXTERN_API(void)
  548.     InvokeMDVRReadUPP               (char *                    midiChars,
  549.                                     short                    length,
  550.                                     long                    refCon,
  551.                                     MDVRReadUPP                userUPP);
  552.  
  553. #else
  554.     enum { uppMIDIReadHookProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  555.     enum { uppMIDITimeProcInfo = 0x000003C0 };                         /* pascal no_return_value Func(4_bytes, 4_bytes) */
  556.     enum { uppMIDIConnectionProcInfo = 0x0009FB80 };                 /* pascal no_return_value Func(2_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes, 1_byte, 2_bytes) */
  557.     enum { uppMDVRCommProcInfo = 0x00000EB0 };                         /* pascal 4_bytes Func(2_bytes, 2_bytes, 4_bytes) */
  558.     enum { uppMDVRTimeCodeProcInfo = 0x00000E80 };                     /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes) */
  559.     enum { uppMDVRReadProcInfo = 0x00000EC0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes, 4_bytes) */
  560.     #define NewMIDIReadHookUPP(userRoutine)                         (MIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIReadHookProcInfo, GetCurrentArchitecture())
  561.     #define NewMIDITimeUPP(userRoutine)                             (MIDITimeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDITimeProcInfo, GetCurrentArchitecture())
  562.     #define NewMIDIConnectionUPP(userRoutine)                         (MIDIConnectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIConnectionProcInfo, GetCurrentArchitecture())
  563.     #define NewMDVRCommUPP(userRoutine)                             (MDVRCommUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRCommProcInfo, GetCurrentArchitecture())
  564.     #define NewMDVRTimeCodeUPP(userRoutine)                         (MDVRTimeCodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRTimeCodeProcInfo, GetCurrentArchitecture())
  565.     #define NewMDVRReadUPP(userRoutine)                             (MDVRReadUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRReadProcInfo, GetCurrentArchitecture())
  566.     #define DisposeMIDIReadHookUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  567.     #define DisposeMIDITimeUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  568.     #define DisposeMIDIConnectionUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  569.     #define DisposeMDVRCommUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  570.     #define DisposeMDVRTimeCodeUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  571.     #define DisposeMDVRReadUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  572.     #define InvokeMIDIReadHookUPP(myPacket, myRefCon, userUPP)         (short)CALL_TWO_PARAMETER_UPP((userUPP), uppMIDIReadHookProcInfo, (myPacket), (myRefCon))
  573.     #define InvokeMIDITimeUPP(curTime, myRefCon, userUPP)             CALL_TWO_PARAMETER_UPP((userUPP), uppMIDITimeProcInfo, (curTime), (myRefCon))
  574.     #define InvokeMIDIConnectionUPP(refnum, refcon, portType, clientID, portID, connect, direction, userUPP)  CALL_SEVEN_PARAMETER_UPP((userUPP), uppMIDIConnectionProcInfo, (refnum), (refcon), (portType), (clientID), (portID), (connect), (direction))
  575.     #define InvokeMDVRCommUPP(refnum, request, refCon, userUPP)     (long)CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRCommProcInfo, (refnum), (request), (refCon))
  576.     #define InvokeMDVRTimeCodeUPP(refnum, newFormat, refCon, userUPP)  CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRTimeCodeProcInfo, (refnum), (newFormat), (refCon))
  577.     #define InvokeMDVRReadUPP(midiChars, length, refCon, userUPP)     CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRReadProcInfo, (midiChars), (length), (refCon))
  578. #endif
  579. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  580. #define NewMIDIReadHookProc(userRoutine)                         NewMIDIReadHookUPP(userRoutine)
  581. #define NewMIDITimeProc(userRoutine)                             NewMIDITimeUPP(userRoutine)
  582. #define NewMIDIConnectionProc(userRoutine)                         NewMIDIConnectionUPP(userRoutine)
  583. #define NewMDVRCommProc(userRoutine)                             NewMDVRCommUPP(userRoutine)
  584. #define NewMDVRTimeCodeProc(userRoutine)                         NewMDVRTimeCodeUPP(userRoutine)
  585. #define NewMDVRReadProc(userRoutine)                             NewMDVRReadUPP(userRoutine)
  586. #define CallMIDIReadHookProc(userRoutine, myPacket, myRefCon)    InvokeMIDIReadHookUPP(myPacket, myRefCon, userRoutine)
  587. #define CallMIDITimeProc(userRoutine, curTime, myRefCon)        InvokeMIDITimeUPP(curTime, myRefCon, userRoutine)
  588. #define CallMIDIConnectionProc(userRoutine, refnum, refcon, portType, clientID, portID, connect, direction) InvokeMIDIConnectionUPP(refnum, refcon, portType, clientID, portID, connect, direction, userRoutine)
  589. #define CallMDVRCommProc(userRoutine, refnum, request, refCon)    InvokeMDVRCommUPP(refnum, request, refCon, userRoutine)
  590. #define CallMDVRTimeCodeProc(userRoutine, refnum, newFormat, refCon) InvokeMDVRTimeCodeUPP(refnum, newFormat, refCon, userRoutine)
  591. #define CallMDVRReadProc(userRoutine, midiChars, length, refCon) InvokeMDVRReadUPP(midiChars, length, refCon, userRoutine)
  592.  
  593.  
  594. #if PRAGMA_STRUCT_ALIGN
  595.     #pragma options align=reset
  596. #elif PRAGMA_STRUCT_PACKPUSH
  597.     #pragma pack(pop)
  598. #elif PRAGMA_STRUCT_PACK
  599.     #pragma pack()
  600. #endif
  601.  
  602. #ifdef PRAGMA_IMPORT_OFF
  603. #pragma import off
  604. #elif PRAGMA_IMPORT
  605. #pragma import reset
  606. #endif
  607.  
  608. #ifdef __cplusplus
  609. }
  610. #endif
  611.  
  612. #endif /* __MIDI__ */
  613.  
  614.